import java.util.Scanner;

public class code2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int T = scan.nextInt();
        while(T-->0) {
            double x1 =scan.nextDouble();
            double y1 =scan.nextDouble();
            double x2 =scan.nextDouble();
            double y2 =scan.nextDouble();
            double x3 =scan.nextDouble();
            double y3 =scan.nextDouble();
            double S = Math.abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2)));//这个S代表面积的两倍
            double L = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
            System.out.printf("%.2f\n",S/L);
        }

    }
}
